package com.xiaodeng.xdblogspringboot.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.Pattern;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

@NoArgsConstructor
@Data
public class User {
    private Integer id;
    @Pattern(regexp = "^[a-zA-Z0-9_.*]{6,16}$",message = "账号仅支持6到16位的数字、字母、‘_’、‘.’和‘*’！")
    private String username;
    @JsonIgnore
    @Pattern(regexp = "^[a-zA-Z0-9_.*]{6,16}$",message = "账号仅支持6到16位的数字、字母、‘_’、‘.’和‘*’！")
    private String password;
    private String nickname;
    private String userPic;
    private String phone;
    @Email(message = "邮箱不能为空")
    private String email;
    @JsonFormat(pattern = "yyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    @JsonFormat(pattern = "yyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;


}
